//
//  ContentView.swift
//  WorldLandmarkDemo
//
//  Created by liy on 2025/2/5.
//复习第一遍2025/02/05

import SwiftUI

struct ContentView: View {
  var body: some View {
    NavigationView {
      List(landmarks) { landmark in
        LandmarkCell(landmark: landmark)
      }
    }
  }
}

#Preview {
  ContentView()
}

struct LandmarkCell: View {
  let landmark: Landmark
  var body: some View {
    NavigationLink(destination: LandmarkDetail(landmark: landmark), label: {
			
      Image(landmark.imageName)
        .resizable()
        .frame(width: 50, height: 50)
        .clipShape(RoundedRectangle(cornerRadius: 10))
        
      VStack(alignment: .leading) {
        Text(landmark.name)
        Text(landmark.location)
          .font(.subheadline)
          .foregroundStyle(.secondary)
      }
    })
  }
}
